﻿<%@ Page Title="Dealer Master" Language="C#" MasterPageFile="~/GEMS.master" AutoEventWireup="true"
    CodeFile="DealerMaster.aspx.cs" Inherits="vp_DealerMastert" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <!----JS validation for  Dealermaster --->
    <script language="javascript" type="text/javascript">
        function validate() {
            var Show = '';

            if (document.getElementById("<%=txtDcode.ClientID %>").value == "") {
                Show = Show + '\n - Enter Reference Code';
            }

            if (document.getElementById("<%=txtCname.ClientID %>").value == "") {
                Show = Show + '\n - Enter Company Name';
            }
            if (document.getElementById("<%=txtDname.ClientID %>").value == "") {
                Show = Show + '\n - Enter Name';
            }

            if ((document.getElementById("<%=txtDmobilenumber.ClientID%>").value == "") && (document.getElementById("<%=txtDofficenumber.ClientID%>").value == "")) {
                Show = Show + ('\n - Enter Your Mobile Number  / Office Number');
            }

            if (document.getElementById("<%=txtDaddress.ClientID %>").value == "") {
                Show = Show + '\n - Enter Address';
            }

            if (document.getElementById("<%=txtManagername.ClientID %>").value == "") {
                Show = Show + '\n - Enter Manager Name';
            }

            if (Show != '') {
                alert(Show);
                return false;
            }
            else {
                return true;
            }
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="container960">
        <div class="container_12 container_16">
            <div class="container_12">
                <div id="main">
                    <div class="full" style="margin: 0px;">
                        <div class="content">
                            <div class="back">
                                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Master/DealerList.aspx"
                                    Text="Back"></asp:HyperLink>
                            </div>
                            <h2>
                                Dealer Master</h2>
                            <div class="Register">
                                <div class="l_col">
                                    <div class="row">
                                        <div class="leftcol grid_2">
                                            <span>Reference Code</span><span class="star">*</span>
                                        </div>
                                        <div class="rightcol">
                                            <asp:TextBox ID="txtDcode" runat="server" CssClass="field" TabIndex="1"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="leftcol grid_2">
                                            <span>Company Name</span><span class="star">*</span>
                                        </div>
                                        <div class="rightcol">
                                            <asp:TextBox ID="txtCname" runat="server" CssClass="field" TabIndex="2"></asp:TextBox>
                                        </div>
                                    </div>
                                </div>
                                <div class="r_col">
                                    <div class="row">
                                        <div class="leftcol grid_2">
                                            <span>Name</span><span class="star">*</span>
                                        </div>
                                        <div class="rightcol">
                                            <asp:TextBox ID="txtDname" runat="server" CssClass="field" TabIndex="3"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="leftcol grid_2">
                                            <span>Tin Number</span>
                                        </div>
                                        <div class="rightcol">
                                            <asp:TextBox ID="txtDtinnumber" runat="server" CssClass="field" TabIndex="4"></asp:TextBox>
                                        </div>
                                    </div>
                                </div>
                                <div class="l_col">
                                    <div class="row">
                                        <div class="leftcol grid_2">
                                            <span>GST No</span>
                                        </div>
                                        <div class="rightcol">
                                            <asp:TextBox ID="txtGstno" runat="server" CssClass="field" TabIndex="5"></asp:TextBox>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="leftcol grid_2">
                                            <span>GCT No</span>
                                        </div>
                                        <div class="rightcol">
                                            <asp:TextBox ID="txtGctno" runat="server" CssClass="field" TabIndex="6"></asp:TextBox>
                                        </div>
                                    </div>
                                </div>
                                <div class="r_col">
                                    <div class="row">
                                        <div class="leftcol grid_2">
                                            <span>PAN No</span>
                                        </div>
                                        <div class="rightcol">
                                            <asp:TextBox ID="txtPanno" runat="server" CssClass="field" TabIndex="7"></asp:TextBox>
                                        </div>
                                    </div>
                                </div>
                                <div class="clear">
                                </div>
                            </div>
                            <div>
                                <h2>
                                    Communication Details</h2>
                                <div class="Register">
                                    <div class="l_col">
                                        <div class="row">
                                            <div class="leftcol grid_2">
                                                <span>Mobile Number</span>
                                            </div>
                                            <div class="rightcol ">
                                                <asp:TextBox ID="txtDmobilenumber" runat="server" CssClass="field" TabIndex="8"></asp:TextBox>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="leftcol grid_2">
                                                <span>Office Number</span>
                                            </div>
                                            <div class="rightcol ">
                                                <asp:TextBox ID="txtDofficenumber" runat="server" CssClass="field" TabIndex="9"></asp:TextBox>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="r_col">
                                        <div class="row" style="height: 60px">
                                            <div class="leftcol grid_2">
                                                <span>Address</span>
                                            </div>
                                            <div class="rightcol ">
                                                <asp:TextBox ID="txtDaddress" runat="server" TextMode="MultiLine" Width="212px" Height="50px"
                                                    CssClass="field1 txtarea" TabIndex="10"></asp:TextBox>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="clear">
                                </div>
                            </div>
                            <div class="2_column">
                                <h2>
                                    Manager Information</h2>
                                <div style="margin-top: 50px;">
                                    <div style="clear: both; margin-bottom: 30px;">
                                        <div class="l_col">
                                            <div class="row">
                                                <div class="leftcol grid_2">
                                               <span>Manager Name</span><span class="star">*</span>
                                                </div>
                                                <div class="rightcol ">
                                                    <asp:TextBox ID="txtManagername" runat="server" CssClass="field text_field" Width="212px"
                                                        Height="24px"  TabIndex="11"></asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="leftcol grid_2">
                                                    <span>Office Address</span>
                                                </div>
                                                <div class="rightcol ">
                                                    <asp:TextBox ID="txtofficeaddress" runat="server" TextMode="MultiLine" Width="212px"
                                                        Height="50px" CssClass="field1 txtarea" TabIndex="12"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="r_col">
                                            <div class="row">
                                                <div class="leftcol grid_2">
                                                    <span>Contact Number</span>
                                                </div>
                                                <div class="rightcol ">
                                                    <asp:TextBox ID="txtContactno" runat="server" CssClass="field text_field" Width="212px"
                                                        Height="24px"  TabIndex="13"></asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="row">
                                                <div class="leftcol grid_2">
                                                    <span>Permanent Address</span>
                                                </div>
                                                <div class="rightcol ">
                                                    <asp:TextBox ID="txtpermanentaddress" runat="server" TextMode="MultiLine" Width="212px"
                                                        Height="50px" CssClass="field1 txtarea"  TabIndex="14"></asp:TextBox>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="grid_btn">
                                            <asp:Button ID="btn_Add" runat="server" Text="Add" CssClass="lgin" 
                                                onclick="btn_Add_Click" />
                                            <asp:Button ID="btn_Clear" runat="server" Text="Clear" CssClass="lgin last_btn" 
                                                onclick="btn_Clear_Click" />
                                        </div>
                                        <div class="clear">
                                        </div>
                                    </div>
                                          <asp:Panel ID="pnlContainerDetails" runat="server" Width="100%">
                                    <div class="grid1">
                                        <asp:GridView ID="GridView1" runat="server" BackColor="White" CssClass="mGrid" GridLines="Vertical" AutoGenerateColumns="false">
                                            <Columns>
                                                <asp:TemplateField HeaderText="Edit">
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="Ibtedt" runat="server" CausesValidation="False" ImageUrl="~/css/images/edit.jpg"
                                                            Text="Edit" ToolTip="Click here to Edit" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Delete">
                                                    <ItemTemplate>
                                                        <asp:ImageButton ID="ibtdlt" runat="server" CausesValidation="False" ImageUrl="~/css/images/delete.gif"
                                                            Text="Delete" ToolTip="Click here to Delete" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>

                                                <asp:BoundField HeaderText="Name" DataField="Name" SortExpression="DealerCode" />


                                                <asp:BoundField HeaderText="officeAdd" DataField="officeAdd" SortExpression="DealerCode" />
                                                <asp:BoundField HeaderText="PermanentAdd" DataField="PermanentAdd" SortExpression="DealerCode" />
                                                <asp:BoundField HeaderText="ContactNo" DataField="ContactNo" SortExpression="DealerCode" />

                                            </Columns>
                                            <HeaderStyle CssClass="header" Height="20px" />
                                        </asp:GridView>
                                    </div>

    </asp:Panel>


                                </div>
                                <div class="clear">
                                </div>
                            </div>
                            <div class="row" style="margin-top: 30px; margin-left: 250px; clear: both">
                                <div class="leftcol grid_2">
                                    &nbsp;</div>
                                <div class="rightcol">
                                    <div class="sub">
                                        <asp:Button ID="svebtn" runat="server" Text="Save" CssClass="lgin" OnClientClick=" return validate();"
                                            OnClick="svebtn_Click" />
                                        <asp:Button ID="clrbtn" runat="server" Text="Clear" CssClass="lgin" OnClientClick="clrCtrl();"
                                            OnClick="clrbtn_Click" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
    </div>

       
    
</asp:Content>
